Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add From, To to XsvRead #13

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

add From, To to XsvRead #13

wants to merge 7 commits into from

Conversation

shigetaichi
Copy link
Owner

No description provided.

if err := r.checkFromTo(); err != nil {
return err
}
i := 1
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a +2 in the bottom line, so the relationship must be examined.

fieldInfo := outInnerStructInfo.Fields[j]
if err := setInnerField(&outInner, outInnerWasPointer, fieldInfo.IndexChain, csvColumnContent, fieldInfo.omitEmpty); err != nil { // Set field of struct
return &csv.ParseError{
Line: i + 2, //add 2 to account for the header & 0-indexing of arrays
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: If From is other than 1, the value entering Line will be incorrect.

} else {
to = len(csvRows)
}
body := csvRows[r.From:to]
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fromも考慮する必要がある。ヘッダーなしcsvが読み込まれている場合とか。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant